<template>
  <div id="app">
    <div class="container">
      <img alt="Vue logo" src="./assets/logo.png">
      <input
        type="text"
        v-model="inputText"
        placeholder="请输入内容"
        class="input-box"
      />
      <HelloWorld
        :text="inputText"
        @clear="handleClear"
      />
    </div>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  data() {
    return {
      inputText: ''
    }
  },
  methods: {
    handleClear() {
      this.inputText = ''
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-box {
  margin: 20px 0;
  padding: 10px;
  font-size: 16px;
  width: 200px;
}
</style>
